﻿using System;

class Program
{
    static void Main()
    {
        
        int[] numbers = { 12, 45, 7, 89, 23, 56, 3 };

       
        int max = numbers[0];
        int min = numbers[0];
        int sum = 0;

        foreach (int num in numbers)
        {
            if (num > max) max = num;
            if (num < min) min = num;
            sum += num;
        }

        double average = (double)sum / numbers.Length;

       
        Console.WriteLine("数组元素为: " + string.Join(", ", numbers));
        Console.WriteLine("最大值: " + max);
        Console.WriteLine("最小值: " + min);
        Console.WriteLine("总和: " + sum);
        Console.WriteLine("平均值: " + average.ToString("F2")); // 保留两位小数
    }
}

